package it.omnisong.client.model;

public class Wikilink{
	
	private String name;
	private String url;
	private String id;
	
	public Wikilink() {
		
	}
	
	/* costruttore */
	public Wikilink(String name, String url) {
		this.name = name;
		this.url = url;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}
	
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		return url.hashCode();	
	}
	
	/* override di equals, verifica sull'url */
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Wikilink) 
			return url.equals(((Wikilink) obj).url);
		return false;
	}
	
	/* toString method */
	public String toString() {
	    return this.getName();
	}

}
